1. Field of the Invention
The present invention relates to an image coding apparatus and a method for compression-coding a vide signal. More specifically, the present invention relates to an apparatus and a method for coding a video signal by slice dividing.
2. Description of the Related Art
As a highly efficient compression-coding method for transmitting or accumulating image information, Moving Picture Experts Group (MPEG)-2 and MPEG-4 are known. In addition, MPEG-4 Part-10: AVC (ISO/IEC 14496-10 “Part-10 Advanced Video Coding”) is proposed, that is also named H.264. These compression methods achieve a high compression rate utilizing an orthogonal transform such as a discrete cosine transform (DCT), a motion compensation, and inter-picture and intra-picture redundancy.
In H.264, pictures to be coded are classified as an I picture, a P picture, and a B picture, according to a difference in a method of prediction. Each picture includes a plurality of macro-blocks (MBs). Further, H.264 divides one picture into slices including a plurality of macro-blocks to perform coding processing slice by slice. When a picture is slice divided, each slice is called an I slice, a P slice, or a B slice, and so on. In a baseline profile of H.264, a B picture is not used.
An image coding apparatus using H.264 can perform coding per picture (a frame or a field). However, coding can be in some cases more easily performed if a frame or a field is divided into a plurality of slices and the slice is taken as a basic unit for coding.
For example, with respect to an image having a high resolution of 1,920×1,088 pixels, an image coding apparatus divides such high-resolution image into a plurality of slices, and codes and decodes each slice in parallel or in time sharing. By dividing an image into slices to perform coding and decoding in a dispersed manner, an image coding apparatus can efficiently perform coding and decoding.
Japanese Patent Application Laid-Open No. 2005-124041 discusses a method of slice division in which a shape of a slice is changed according to an error in a transmission path, or a motion of an image. Furthermore, Japanese Patent Application Laid-Open No. 2004-235683 discusses the slice division using a coding method devised in the course of standardizing H.264/AVC (this coding method is called H.26L or JVT), which adjusts a code amount to perform slice division.
A slice compliant with H.264 is divided using a data block, namely, a macro-block as a unit for coding processing. That is, a slice includes one or more macro-blocks arranged in a horizontal or vertical direction.
FIG. 17 illustrates a relationship between a slice and a macro-block. Referring to FIG. 17, one picture is horizontally divided into three. That is, one picture includes three slices.
Each slice includes a plurality of macro-blocks. Macro-blocks 152 and 154 are included in a first slice, and are adjacent to a boundary between first and second slices. A macro-block 150 is included in the second slice and is adjacent to the boundary between the first and the second slices.
A slice can take not only a rectangular or strip-like shape illustrated in FIG. 17, but also an arbitrary shape, when a method called a “flexible macro-block order (FMO)” or “slice grouping” is used. Division into slices can be performed in any profile as long as it is performed in the order of rasterization of macro-blocks. However, slice grouping is used only in a baseline profile and an extended profile.
When an image coding apparatus using H.264 utilizes slice division, a slice serves as the basic unit for coding. That is, information about macro-blocks included in another slice cannot be utilized for coding. For example, in FIG. 17, information about the macro-blocks 152 and 154 cannot be utilized for coding the macro-block 150.
As a result, prediction efficiency of intrapicture prediction and interpicture prediction is reduced near the boundary of the slices. Thus, efficiency of coding is reduced.
Context-based Adaptive Binary Arithmetic Coding (CABAC), which is an entropy coding method characteristic of H.264, improves coding efficiency by varying a probability table according to advance of coding processing. The probability table is initialized at the time of start of coding a slice, and thus the probability table becomes different state from a probability distribution that a coding target object has.
This state continues until the coding processing advances to a stage at which the probability table becomes adaptive to the probability distribution of the coding target object. Accordingly, near a slice boundary, which corresponds to a portion immediately after the initialization of the probability table, the coding efficiency is reduced.
As a result of the reduced coding efficiency near the slice boundary, an amount of generated codes increases in macro-blocks located close to the slice boundary. However, in order to control a total amount of codes, the amount of generated codes is restrained.
Accordingly, degradation of image quality occurs in the macro-blocks located close to the slice boundary and the slice boundary becomes visible. In particular, if the horizontally arranged macro-blocks are consecutively degraded, degradation of image quality can be easily recognized as noise.
Here, as illustrated in FIG. 18 and FIG. 19, each of consecutive pictures have slices divided at the same position.
FIG. 18 illustrates an example in which consecutive pictures (00, 01, 02, 03, 04, 05 . . . ) are divided into slices at the same position. FIG. 19 illustrates a division position of the slice when each picture in FIG. 18 is illustrated in cross section.
The symbol “I” added before the number of a picture indicates that the picture is an I picture. In the same way, the symbol “B” indicates a B picture, and the symbol “P” indicates a P picture. For example, “B02” indicates a picture No. 02, which is a B picture.
Referring to FIG. 19, horizontal broken lines 170 and 172, which link slice division positions of each picture indicate that the slice boundary is located at a certain position on a screen. Thus, if the slice boundary is positioned at a certain position on the screen for consecutive plural pictures as described above, noise appearing near the slice boundary can be more easily recognized.
The image degradation occurring near the slice boundary can become less visible if the shape of the slice is changed at random.
However, if the shape of the slice is changed at random, the coding and decoding processing become complicated. For example, the position of each macro-block always needs to be confirmed whether the macro-block is located adjacent to the slice boundary.